home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / STFX-soundsystemdisk.adf / sources / fxplayer.s < prev    next >
Text File  |  1988-01-20  |  14KB  |  654 lines

  1. ****************************************************************************
  2. *                                       *    
  3. *                                       *
  4. *          Sound Abspiel Routine zu Sound FX                  *
  5. *                                       *
  6. *               © 1988 LINEL Switzerland                   *    
  7. *                                       *    
  8. *                                       *    
  9. *                                       *
  10. ****************************************************************************
  11.  
  12. ;Einbau:
  13. ;    1.Sound FX laden
  14. ;    2.Song schreiben oder einladen
  15. ;    3.Sounddaten mit Save Datas abspeichern 
  16. ;    4.Sound FX verlassen und Seka laden
  17. ;    5.Source des Programms laden in den wir den Song einbauen
  18. ;      wollen.
  19. ;    6.Am Anfang des Programms 'bsr StartSound' einsetzen
  20. ;    7.Am Schluss des Programms 'bsr StopSound' einsetzen
  21. ;    8.Diesen AbspielSource laden
  22. ;    9.Das Label 'Laenge' auf die Laenge des Datenfiles setzen
  23. ;    10.Assemblieren
  24. ;    11.DatenFile mit 'ri' nach 'datas' laden
  25. ;    12.fertig
  26.  
  27. ;------------------------------------------------------------------------
  28.  
  29.  
  30.     Laenge = 60000            ;Länge der Sounddaten
  31.  
  32. ;------------------------------------------------------------------------
  33. Beispiel:
  34.     bsr.s    StartSound
  35.     bsr.s    Intro
  36.     bsr.L    StopSound
  37.     moveq    #0,d0
  38.     rts
  39. ;-------------------------------------------------------------------------
  40.  
  41. Intro:
  42.     move    d0,$dff180
  43.     addq    #1,d0
  44.     btst    #6,$bfe001
  45.     bne.s    Intro
  46.     rts
  47.  
  48. ;---------------------------------------------------------------------------
  49.  
  50. ;Ergebis in D0           0=alles Ok.        $ff = Timer nicht bekommen
  51.  
  52. StartSound:
  53.     movem.l    d1-d7/a0-a6,-(SP)
  54.     clr    ChipFlag        ;Flag fuer Daten im Chip
  55.     move.l    4,a6            ;ExecBase
  56.     move.l    SongPointer(pc),a1    ;Zeiger auf Daten
  57.     jsr    -534(A6)        ;TypeOfMem()
  58.     btst    #1,d0            ;Sind Daten im Chip ?
  59.     bne.s    ChipOK            ;ja ->
  60.     st    ChipFlag        ;Flag fuer AllocMemChip setzen
  61.     move.l    #Laenge,d0        ;wenn Fast Memory ->
  62.     addq.l    #4,d0            
  63.     moveq    #2,d1            ;Chip Speicher
  64.     jsr    -198(a6)        ;reservieren
  65.     moveq    #-1,d5            ;Fehlerflag
  66.     tst.l    d0            ;Speicher bekommen ?
  67.     beq.L    EndStart        ;wenn nicht -> Ende
  68.     move.l    d0,a1            ;Ziel
  69.     move.l    SongPointer(pc),a0    ;Quelle
  70.     move.l    #Laenge,d1
  71.     addq.l    #4,d1            ;Reserve
  72.     lsr.l    #2,d1            ;divu #4
  73.     subq    #1,d1            ;für dbf
  74. CopyMem:
  75.     move.l    (a0)+,(A1)+        ;Daten ins ChipMem
  76.     move    (a0),$dff180
  77.     dbf    d1,CopyMem        ;kopieren
  78.     move.l    d0,SongPointer
  79.  
  80. ChipOk:
  81.     move.l    SongPointer(pc),a0    ;Zeiger auf SongDaten
  82.     add    #60,a0            ;Laengentabelle ueberspringen
  83.     move.b    470(a0),AnzPat+1    ;Laenge des Sounds
  84.     move    4(A0),DelayValue     ;Geschwindigkeit
  85.     bsr    SongLen            ;Länge der Songdaten berechnen
  86.     add.l    d0,a0            ;Zur Adresse der Songstr.
  87.     add.w    #600,a0            ;Laenge der SongStr.
  88.     move.l    SongPointer(pc),a2
  89.     lea    Instruments(pc),a1    ;Tabelle auf Samples
  90.     moveq    #14,d7            ;15 Instrumente
  91. CalcIns:
  92.     move.l    a0,(A1)+        ;Startadresse des Instr.
  93.     add.l    (a2)+,a0        ;berechnen un speichern
  94.     dbf    d7,CalcIns
  95.  
  96.     lea    CiaaResource(pc),a1    ;'ciaa.resource'
  97.     moveq    #0,d0            ;Version egal
  98.     jsr    -498(A6)        ;OpenResource()
  99.     move.l    d0,CiaaBase        ;Resource Base speichern
  100.     move.l    d0,a6
  101.     bsr    PlayDisable        ;Sound DMA abschalten
  102.     lea    Interrupt(pc),a1    ;Sound Interupt Structure
  103.     moveq    #0,d0            ;TimerA
  104.     jsr    -6(A6)            ;installieren
  105.     move.l    d0,d5            ;ergebnis speichern
  106.     bsr    PlayInit        ;Loop Bereich setzen
  107.     bsr    PlayEnable        ;Player erlauben
  108.     bsr    InitTimer        ;Timer starten
  109.     moveq    #0,d0            ;Ergebnisregister loeschen
  110. EndStart:
  111.     tst.l    d5            ;ergebnis von Resource
  112.     sne    d0            ;ergebnis in d0 setzen 
  113.     movem.l    (SP)+,d1-d7/a0-a6
  114.     rts
  115.  
  116. ;---------------------------------------------------------------------------
  117.  
  118. StopSound:
  119.     movem.l    d1-d7/a0-a6,-(SP)
  120.     move.l    4,a6            ;ExecBase
  121.     tst    ChipFlag        ;mussten wir Speicher reservieren ?
  122.     beq.s    NoFreeSong        
  123.     move.l    #Laenge,d0        ;Länge der Daten
  124.     addq.l    #4,d0            ;Reserve
  125.     move.l    SongPointer(pc),a1    ;Zeiger auf Daten
  126.     jsr    -210(a6)        ;FreeMem()
  127. NoFreeSong:
  128.     move.l    CiaaBase(pc),a6        ;Zeiger auf Ciaa Resource
  129.     lea    Interrupt(pc),a1    ;Zeiger auf Int. Strukture
  130.     moveq    #0,d0            ;Timer A
  131.     jsr    -12(A6)            ;Interupt entfernen
  132.     bsr    PlayDisable        ;Player sperren
  133.     moveq    #0,d0            ;Alles Ok    
  134.     movem.l    (SP)+,d1-d7/a0-a6
  135.     rts
  136. ;---------------------------------------------------------------------------
  137.  
  138. SongLen:
  139.     movem.l    d1-d7/a0-a6,-(SP)
  140.     move.l    SongPointer,a0
  141.     lea    532(A0),a0
  142.     move    AnzPat(pc),d2        ;wieviel Positions
  143.     subq    #1,d2            ;für dbf
  144.     moveq    #0,d1
  145.     moveq    #0,d0
  146. SongLenLoop:
  147.     move.b    (a0)+,d0        ;Patternnummer holen
  148.     cmp.b    d0,d1            ;ist es die höchste ?
  149.     bhi.s    LenHigher        ;nein!
  150.     move.b    d0,d1            ;ja
  151. LenHigher:
  152.     dbf    d2,SongLenLoop
  153.     move.l    d1,d0            ;Hoechste BlockNummer nach d0
  154.     addq    #1,d0            ;plus 1
  155.     mulu    #1024,d0        ;Laenge eines Block
  156.     movem.l    (SP)+,d1-d7/a0-a6
  157.     rts
  158.  
  159. ;--------------------------------------------------------------------    
  160.  
  161.  
  162. Interrupt:
  163.     dc.l    0            ;letzter Node
  164.     dc.l    0            ;nächster Node
  165.     dc.b    2            ;Node Type = Interrupt
  166.     dc.b    0             ;Priorität
  167.     dc.l    InterruptName        ;Name
  168.     dc.l    0            ;Zeiger auf Daten
  169.     dc.l    IntCode            ;Interrupt Routine
  170.  
  171. ;-------------------------------------------------------------------
  172.  
  173. InitTimer:
  174.     move.b    #%10000001,$bfee01    ;Timer starten
  175.     lea    DelayValue(pc),a1
  176.     move.b    1(a1),$bfe401        ;Timer A low
  177.     move.b    0(a1),$bfe501        ;Timer A high
  178.     rts
  179.  
  180. ;--------------------------------------------------------------------
  181.  
  182. PlayInit:
  183.     lea    Instruments(pc),a0    ;Zeiger auf instr.Tabelle
  184.     moveq    #14,d7            ;15 Instrumente
  185. InitLoop:    
  186.     move.l    (A0)+,a1        ;Zeiger holen
  187.     clr.l    (A1)            ;erstes Longword löschen
  188.     dbf    d7,InitLoop
  189.     rts
  190.  
  191. ;-----------------------------------------------------------------------
  192.  
  193. PlayEnable:
  194.     lea    $dff000,a0        ;AMIGA
  195.     move.w    #-1,PlayLock        ;player zulassen
  196.     clr    $a8(A0)            ;Alle Voloumenregs. auf 0
  197.     clr    $b8(A0)
  198.     clr    $c8(a0)
  199.     clr    $d8(a0)
  200.     clr.w    Timer            ;zahler auf 0
  201.     clr.l    TrackPos        ;zeiger auf pos
  202.     clr.l    PosCounter        ;zeiger innehalb des pattern
  203.     rts
  204. ;----------------------------------------------------------------------
  205.  
  206. PlayDisable:
  207.     lea    $dff000,a0        ;AMIGA
  208.     clr.w    PlayLock        ;player sperren
  209.     clr    $a8(a0)            ;volumen auf 0
  210.     clr    $b8(a0)
  211.     clr    $c8(a0)
  212.     clr    $d8(a0)
  213.     move.w    #$f,$96(A0)        ;dma sperren
  214.     rts
  215.  
  216. ;---------------------------------------------------------------------
  217.  
  218. IntCode:
  219.     bsr    PlaySong        ;Note spielen
  220.     moveq    #0,d0            ;kein Fehler
  221.     rts
  222.  
  223. ;----------------------------------------------------------------------
  224.  
  225.  
  226. ;hier werden 5 * effekte gespielt und einmal der song
  227.  
  228. PlaySong:                ;HauptAbspielRoutine
  229.     movem.l    d0-d7/a0-a6,-(SP)
  230.     addq.w    #1,Timer        ;zähler erhöhen
  231.     cmp.w    #6,Timer        ;schon 6?
  232.     bne.s    CheckEffects        ;wenn nicht -> effekte
  233.     clr.w    Timer            ;sonst zähler löschen
  234.     bsr     PlaySound        ;und sound spielen
  235. NoPlay:    movem.l    (SP)+,d0-d7/a0-a6
  236.     rts
  237.  
  238. ;-------------------------------------------------------------------
  239. CheckEffects:
  240.     moveq    #3,d7            ;4 kanäle
  241.     lea    StepControl0,a4
  242.     lea    ChannelData0(pc),a6    ;zeiger auf daten für 0
  243.     lea    $dff0a0,a5        ;Kanal 0
  244. EffLoop:
  245.     movem.l    d7/a5,-(SP)
  246.     bsr.s    MakeEffekts        ;Effekt spielen
  247.     movem.l    (Sp)+,d7/a5
  248. NoEff:
  249.     add    #8,a4
  250.     add    #$10,a5            ;nächster Kanal
  251.     add    #22,a6            ;Nächste KanalDaten
  252.     dbf    d7,EffLoop
  253.     movem.l    (a7)+,d0-d7/a0-a6
  254.     rts
  255.  
  256. MakeEffekts:
  257.     move    (A4),d0
  258.     beq.s    NoStep
  259.     bmi.s    StepItUp
  260.     add    d0,2(A4)
  261.     move    2(A4),d0
  262.     move    4(A4),d1
  263.     cmp    d0,d1
  264.     bhi.s    StepOk
  265.     move    d1,d0
  266. StepOk:
  267.     move    d0,6(a5)
  268.     MOVE    D0,2(A4)
  269.     rts
  270.  
  271. StepItUp:
  272.     add    d0,2(A4)
  273.     move    2(A4),d0
  274.     move    4(A4),d1
  275.     cmp    d0,d1
  276.     blt.s    StepOk
  277.     move    d1,d0
  278.     bra.s    StepOk
  279.  
  280.  
  281.  
  282. NoStep:
  283.     move.b    2(a6),d0
  284.     and.b    #$0f,d0
  285.     cmp.b    #1,d0
  286.     beq    appreggiato
  287.     cmp.b    #2,d0
  288.     beq    pitchbend
  289.     cmp.b    #3,d0
  290.     beq    LedOn
  291.     cmp.b    #4,d0
  292.     beq    LedOff
  293.     cmp.b    #7,d0
  294.     beq.s    SetStepUp
  295.     cmp.b    #8,d0
  296.     beq.s    SetStepDown
  297.     rts
  298.  
  299. LedOn:
  300.     bset    #1,$bfe001
  301.     rts
  302. LedOff:
  303.     bclr    #1,$bfe001
  304.     rts
  305.  
  306. SetStepUp:
  307.     moveq    #0,d4
  308. StepFinder:
  309.     clr    (a4)
  310.     move    (A6),2(a4)
  311.     moveq    #0,d2
  312.     move.b    3(a6),d2
  313.     and    #$0f,d2
  314.     tst    d4
  315.     beq.s    NoNegIt
  316.     neg    d2
  317. NoNegIt:    
  318.     move    d2,(a4)
  319.     moveq    #0,d2
  320.     move.b    3(a6),d2
  321.     lsr    #4,d2
  322.     move    (a6),d0
  323.     lea    NoteTable,a0
  324.  
  325. StepUpFindLoop:
  326.     move    (A0),d1
  327.     cmp    #-1,d1
  328.     beq.s    EndStepUpFind
  329.     cmp    d1,d0
  330.     beq.s    StepUpFound
  331.     addq    #2,a0
  332.     bra.s    StepUpFindLoop
  333. StepUpFound:
  334.     lsl    #1,d2
  335.     tst    d4
  336.     bne.s    NoNegStep
  337.     neg    d2
  338. NoNegStep:
  339.     move    (a0,d2.w),d0
  340.     move    d0,4(A4)
  341.     rts
  342.  
  343. EndStepUpFind:
  344.     move    d0,4(A4)
  345.     rts
  346.     
  347. SetStepDown:
  348.     st    d4
  349.     bra.s    StepFinder
  350.  
  351.  
  352. StepControl0:
  353.     dc.l    0,0
  354. StepControl1:
  355.     dc.l    0,0
  356. StepControl2:
  357.     dc.l    0,0
  358. StepControl3:
  359.     dc.l    0,0
  360.  
  361.  
  362. appreggiato:
  363.     lea    ArpeTable,a0
  364.     moveq    #0,d0
  365.     move    Timer,d0
  366.     subq    #1,d0
  367.     lsl    #2,d0
  368.     move.l    (A0,d0.l),a0
  369.     jmp    (A0)
  370.  
  371. Arpe4:    lsl.l    #1,d0
  372.     clr.l    d1
  373.     move.w    16(a6),d1
  374.     lea.l    NoteTable,a0
  375. Arpe5:    move.w    (a0,d0.l),d2
  376.     cmp.w    (a0),d1
  377.     beq.s    Arpe6
  378.     addq.l    #2,a0
  379.     bra.s    Arpe5
  380.  
  381.  
  382.  
  383. Arpe1:    clr.l    d0
  384.     move.b    3(a6),d0
  385.     lsr.b    #4,d0
  386.     bra.s    Arpe4
  387.  
  388.  
  389. Arpe2:    clr.l    d0
  390.     move.b    3(a6),d0
  391.     and.b    #$0f,d0
  392.     bra.s    Arpe4
  393.  
  394. Arpe3:    move.w    16(a6),d2
  395.     
  396. Arpe6:    move.w    d2,6(a5)
  397.     rts
  398.  
  399.  
  400. pitchbend:
  401.     clr.l    d0
  402.     move.b    3(a6),d0
  403.     lsr.b    #4,d0
  404.     tst.b    d0
  405.     beq.s    pitch2
  406.     add.w    d0,(a6)
  407.     move.w    (a6),6(a5)
  408.     rts
  409. pitch2:    clr.l    d0
  410.     move.b    3(a6),d0
  411.     and.b    #$0f,d0
  412.     tst.b    d0
  413.     beq.s    pitch3
  414.     sub.w    d0,(a6)
  415.     move.w    (a6),6(a5)
  416. pitch3:    rts
  417.  
  418.  
  419. ;--------------------------------------------------------------------
  420.  
  421. PlaySound:
  422.     move.l    SongPointer(pc),a0    ;Zeiger auf SongFile
  423.     add    #60,a0            ;Laengentabelle ueberspringen
  424.     move.l    a0,a3
  425.     move.l    a0,a2
  426.     lea    600(A0),a0        ;Zeiger auf BlockDaten
  427.     add    #472,a2            ;zeiger auf Patterntab.
  428.     add    #12,a3            ;zeiger auf Instr.Daten
  429.     move.l    TrackPos(pc),d0        ;Postionzeiger
  430.     clr.l    d1
  431.     move.b    (a2,d0.l),d1        ;dazugehörige PatternNr. holen
  432.     moveq    #10,d7
  433.     lsl.l    d7,d1            ;*1024 / länge eines Pattern
  434.     add.l    PosCounter,d1        ;Offset ins Pattern
  435.     clr.w    DmaCon
  436.     lea    StepControl0,a4
  437.     lea    $dff0a0,a5        ;Zeiger auf Kanal0
  438.     lea    ChannelData0(pc),a6    ;Daten für Kanal0
  439.     moveq    #3,d7            ;4 Kanäle
  440. SoundHandleLoop:
  441.     bsr    PlayNote        ;aktuelle Note spielen
  442.     add    #8,a4
  443.     add.l    #$10,a5            ;nächster Kanal
  444.     add.l    #22,a6            ;nächste Daten
  445.     dbf    d7,SoundHandleLoop    ;4*
  446.     
  447.     move    DmaCon(pc),d0        ;DmaBits
  448.     bset    #15,d0            ;Clear or Set Bit setzen
  449.     move.w    d0,$dff096        ;DMA ein!
  450.  
  451.     move    #300,d0            ;Verzögern (genug für MC68030)
  452. Delay2:
  453.     dbf    d0,Delay2
  454.  
  455.     lea    ChannelData3(pc),a6
  456.     lea    $dff0d0,a5
  457.     moveq    #3,d7
  458. SetRegsLoop:
  459.     move.l    10(A6),(a5)        ;Adresse
  460.     move    14(A6),4(A5)        ;länge
  461. NoSetRegs:
  462.     sub    #22,a6            ;nächste Daten
  463.     sub    #$10,a5            ;nächster Kanal
  464.     dbf    d7,SetRegsLoop
  465.     tst    PlayLock
  466.     beq.s    NoEndPattern
  467.     add.l    #16,PosCounter        ;PatternPos erhöhen
  468.     cmp.l    #1024,PosCounter    ;schon Ende ?
  469.     blt.s    NoEndPattern
  470.  
  471.     clr.l    PosCounter        ;PatternPos löschen
  472.     addq.l    #1,TrackPos        ;Position erhöhen
  473. NoAddPos:
  474.     move.w    Anzpat(pc),d0        ;AnzahlPosition
  475.     move.l    TrackPos(pc),d1        ;Aktuelle Pos
  476.     cmp.w    d0,d1            ;Ende?
  477.     bne.s    NoEndPattern        ;nein!
  478.     clr.l    TrackPos        ;ja/ Sound von vorne
  479. NoEndPattern:
  480.     rts
  481.  
  482.  
  483.  
  484. PlayNote:
  485.     clr.l    (A6)
  486.     tst    PlayLock        ;Player zugellassen ?
  487.     beq.s    NoGetNote        ;
  488.     move.l    (a0,d1.l),(a6)        ;Aktuelle Note holen
  489. NoGetNote:
  490.     addq.l    #4,d1            ;PattenOffset + 4
  491.     clr.l    d2
  492.     cmp    #-3,(A6)        ;Ist Note = 'PIC' ?
  493.     beq    NoInstr2        ;wenn ja -> ignorieren
  494.     move.b    2(a6),d2        ;Instr Nummer holen    
  495.     and.b    #$f0,d2            ;ausmaskieren
  496.     lsr.b    #4,d2            ;ins untere Nibble
  497.     tst.b    d2            ;kein Intrument ?
  498.     beq.L    NoInstr2        ;wenn ja -> überspringen
  499.     
  500.     clr.l    d3
  501.     lea.l    Instruments(pc),a1    ;Instr. Tabelle
  502.     move.l    d2,d4            ;Instrument Nummer
  503.     subq    #1,d2
  504.     lsl    #2,d2            ;Offset auf akt. Instr.
  505.     mulu    #30,d4            ;Offset Auf Instr.Daten
  506.     move.l    (a1,d2.w),4(a6)        ;Zeiger auf akt. Instr.
  507.     move.w    (a3,d4.l),8(a6)        ;Instr.Länge
  508.     move.w    2(a3,d4.l),18(a6)    ;Volume
  509.     move.w    4(a3,d4.l),d3        ;Repeat
  510.     tst    d3            ;kein Repeat?
  511.     beq.s    NoRepeat        ;Nein!
  512.                     ;Doch!
  513.     
  514.     move.l    4(a6),d2        ;akt. Instr.
  515.     add.l    d3,d2            ;Repeat dazu
  516.     move.l    d2,10(a6)        ;Repeat Instr.
  517.     move.w    6(a3,d4),14(a6)        ;rep laenge
  518.     move.w    18(a6),d3         ;Volume in HardReg.
  519.     bra.s    NoInstr
  520.  
  521. NoRepeat:
  522.     move.l    4(a6),d2        ;Instrument    
  523.     add.l    d3,d2            ;rep Offset
  524.     move.l    d2,10(a6)        ;in Rep. Pos.
  525.     move.w    6(a3,d4.l),14(a6)    ;rep Laenge
  526.     move.w    18(a6),d3         ;Volume in Hardware
  527.  
  528. CheckPic:
  529. NoInstr:
  530.     move.b    2(A6),d2
  531.     and    #$0f,d2
  532.     cmp.b    #5,d2
  533.     beq.s    ChangeUpVolume
  534.     cmp.b    #6,d2
  535.     bne.L    SetVolume2
  536.     moveq    #0,d2
  537.     move.b    3(A6),d2
  538.     sub    d2,d3        
  539.     tst    d3
  540.     bpl    SetVolume2    
  541.     clr    d3
  542.     bra.L    SetVolume2
  543. ChangeUpVolume:
  544.     moveq    #0,d2
  545.     move.b    3(A6),d2
  546.     add    d2,d3
  547.     tst    d3
  548.     cmp    #64,d3
  549.     ble.L    SetVolume2
  550.     move    #64,d3
  551. SetVolume2:
  552.     move    d3,8(A5)
  553.     
  554. NoInstr2:
  555.     cmp    #-3,(A6)        ;Ist Note = 'PIC' ?
  556.     bne.s    NoPic        
  557.     clr    2(A6)            ;wenn ja -> Note auf 0 setzen
  558.     bra.s    NoNote    
  559. NoPic:
  560.     tst    (A6)            ;Note ?
  561.     beq.s    NoNote            ;wenn 0 -> nicht spielen
  562.     
  563.     clr    (a4)
  564.     move.w    (a6),16(a6)        ;eintragen
  565.     move.w    20(a6),$dff096        ;dma abschalten
  566.     move.l    d7,-(SP)
  567.     move    #300,d7            ;genug für MC68030
  568. Delay1:
  569.     dbf    d7,Delay1        ;delay
  570.     move.l    (SP)+,d7
  571.     cmp    #-2,(A6)        ;Ist es 'STP'
  572.     bne.s    NoStop            ;Nein!
  573.     clr    8(A5)
  574.     bra    Super
  575. NoStop:
  576.     move.l    4(a6),0(a5)        ;Intrument Adr.
  577.     move.w    8(a6),4(a5)        ;Länge
  578.     move.w    0(a6),6(a5)        ;Period
  579. Super:
  580.     move.w    20(a6),d0        ;DMA Bit
  581.     or.w    d0,DmaCon        ;einodern
  582. NoNote:
  583.     rts
  584.  
  585. ;--------------------------------------------------------------------
  586. ArpeTable:
  587.     dc.l    Arpe1
  588.     dc.l    Arpe2
  589.     dc.l    Arpe3
  590.     dc.l    Arpe2
  591.     dc.l    Arpe1
  592.  
  593.  
  594. ChannelData0:
  595.     blk.l    5,0            ;Daten für Note
  596.     dc.w    1            ;DMA - Bit
  597. ChannelData1:    
  598.     blk.l    5,0            ;u.s.w
  599.     dc.w    2
  600. ChannelData2:    
  601.     blk.l    5,0            ;etc.
  602.     dc.w    4
  603. ChannelData3:    
  604.     blk.l    5,0            ;a.s.o
  605.     dc.w    8
  606. Instruments:
  607.     blk.l    15,0            ;Zeiger auf die 15 Instrumente
  608. PosCounter:
  609.     dc.l    0            ;Offset ins Pattern
  610. TrackPos:
  611.     dc.l    0            ;Position Counter
  612. Timer:
  613.     dc.w    0            ;Zähler 0-5
  614. DmaCon:
  615.     dc.w    0            ;Zwischenspeicher für DmaCon
  616. AnzPat:
  617.     dc.w    1            ;Anzahl Positions
  618. PlayLock:
  619.     dc.w    0            ;Flag fuer 'Sound erlaubt'
  620. DelayValue:
  621.     dc.w    14565
  622. SongPointer:
  623.     dc.l    LenghtTable
  624. ChipFlag:
  625.     dc.w    0
  626. CiaaBase:
  627.     dc.l    0
  628. InterruptName:
  629.     dc.b    "Chris's SoundInterrupt",0
  630. CiaaResource:
  631.     dc.b    'ciaa.resource',0
  632.  
  633.  
  634. even
  635.  
  636. Reserve:
  637.     dc.w    856,856,856,856,856,856,856,856,856,856,856,856
  638. NoteTable:
  639.     dc.w    856,808,762,720,678,640,604,570,538,508,480,453   ;1.Okt
  640.     dc.w    428,404,381,360,339,320,302,285,269,254,240,226   ;2.Okt
  641.     dc.w    214,202,190,180,170,160,151,143,135,127,120,113      ;3.Okt
  642.     dc.w    113,113,113,113,113,113,113,113,113,113,113,113      ;Reserve
  643.     dc.w    -1
  644.  
  645. LenghtTable:
  646.  
  647. Datas:
  648.     Songstr = lenghttable+60
  649.     
  650.     blk.b    Laenge,0        ;hierhin die Daten!!!
  651.  
  652. EndSongStr:
  653.  
  654.